package seeders

import (
	"github.com/goravel/framework/facades"
	"goravel/app/models/systemEntity"
)

type ButtonPermissionSeeder struct {
}

// Signature The name and signature of the seeder.
func (s *ButtonPermissionSeeder) Signature() string {
	return "ButtonPermissionSeeder"
}

// Run executes the seeder logic.
func (s *ButtonPermissionSeeder) Run() error {
	btn_prs := []systemEntity.ButtonPermission{
		//用户
		{
			Code:  "user:btn:add",
			Label: "用户添加",
		},
		{
			Code:  "user:btn:edit",
			Label: "用户编辑",
		},
		{
			Code:  "user:btn:del",
			Label: "用户删除",
		},
		{
			Code:  "user:btn:show",
			Label: "用户查看",
		},
		//用户组
		{
			Code:  "usergroup:btn:add",
			Label: "用户组添加",
		},
		{
			Code:  "usergroup:btn:edit",
			Label: "用户组编辑",
		},
		{
			Code:  "usergroup:btn:del",
			Label: "用户组删除",
		},
		{
			Code:  "usergroup:btn:show",
			Label: "用户组查看",
		},

		//	系统-角色
		{
			Code:  "role:btn:add",
			Label: "角色添加",
		},
		{
			Code:  "role:btn:edit",
			Label: "角色编辑",
		},
		{
			Code:  "role:btn:del",
			Label: "角色删除",
		},
		{
			Code:  "role:btn:show",
			Label: "角色查看",
		},
		//	系统-权限
		{
			Code:  "permission:btn:add",
			Label: "权限添加",
		},
		{
			Code:  "permission:btn:edit",
			Label: "权限编辑",
		},
		{
			Code:  "permission:btn:del",
			Label: "权限删除",
		},
		{
			Code:  "permission:btn:show",
			Label: "权限查看",
		},
	}
	return facades.Orm().Query().Model(&systemEntity.ButtonPermission{}).Create(&btn_prs)
}
